<template>
	<view>
		<view class="worker" v-if="loginType == 6 ">
			<image src="https://renovationcdn.jiachuangnet.com/index/workerIndex/bg.png" class='bg' style=""></image>
			<view style="position: absolute;top:0;left:25rpx;z-index: 1000;width: 700rpx;padding-bottom: 100rpx;">
				<view @click='timePopShow=true' style="display: flex;justify-content: center;"
					:style="{'marginTop':searchBarTop + 'px','lineHeight':searchBarHeight +'px'}">
					<view class="todayTask" style="">{{timeText}}</view>
					<u-icon name="arrow-down-fill"></u-icon>
				</view>
				<view style="margin:40rpx 0;margin-bottom:15rpx;display: flex;align-items: center;">
					<image style="width: 25rpx;height: 32rpx"
						src="https://renovationcdn.jiachuangnet.com/index/workerIndex/map.png"></image>
					<view @click="provinceShow=true" style="" class="province">{{province}}</view>
					<view class="workerSearch" style="">
						<image style="width: 34rpx;height: 34rpx;"
							src="https://renovationcdn.jiachuangnet.com/index/workerIndex/search.png"></image>
						<u-input @blur='blurSearch' placeholder="请输入您想搜索的内容" style="height: 78rpx;"
							v-model="keyword"></u-input>
					</view>
					<view v-if="false" style="margin-left: 24rpx;">
						<view style="display: flex;justify-content: center">
							<image style="width: 28rpx;height: 28rpx"
								src="https://renovationcdn.jiachuangnet.com/index/workerIndex/news.png"></image>
						</view>
						<view>消息</view>
					</view>
				</view>

				<u-tabs @click='tabsClick' :activeStyle="{'fontSize':'28rpx','fontWeight':'700','color':'#1e272e'}"
					:inactiveStyle="{'fontSize':'28rpx','fontWeight':'500','color':'#868686'}" :lineColor='color'
					:list="statusList" :scrollable="false" :current="currentTab"></u-tabs>
				<view class="listContent">
					<view v-for="(v,i) in storeList" :key="i" class="listItem">
						<view class="stateTag" style="">
							<text v-if="v.state == 0">待开始</text>
							<text v-if="v.state == 1">进行中</text>
							<text v-if="v.state == 3">已完成</text>
							<text v-if="v.state == 2">已逾期</text>
						</view>
						<view class="stateBtn btn" v-if="v.state == 0" @click='startTask(v.distributionId)'>
							开始
						</view>
						<view class="stateBtn btn" v-if="v.state == 1" @click="startOption(v.distributionId)">
							继续作业
						</view>
						<view class="stateBtn btn" v-if="v.state == 3" @click="checkOption(v.distributionId)">
							查看
						</view>
						<!-- <view class="stateBtn btn" v-if="v.state == 3"  @click="reviewAcceptance(v.distributionId,v.state)">
							查看
						</view> -->
						<view class="stateBtn btn" v-if="v.state == 2">
							<view v-if="!(v.startTime)" @click='startTask(v.distributionId)'> 开始</view>
							<view v-else @click="startOption(v.distributionId)">继续作业</view>
						</view>
						<image v-if="v.state == 2" src="https://renovationcdn.jiachuangnet.com/index/yiyuqi.png"
							style="width: 178rpx;height:154rpx;position: absolute;top:10rpx;left:0rpx;z-index:10000">
						</image>
						<image :src="v.storeImg" v-if="v.storeImg"
							style="width:210rpx;height: 220rpx;border-radius: 20rpx;"></image>
						<image v-else src="https://renovationcdn.jiachuangnet.com/index/workerIndex/shop.png"
							style="width:210rpx;height: 220rpx;"></image>
						<view style="width:calc(100% - 230rpx);margin-left:20rpx;">
							<view style="font-weight: bold;
font-size: 36rpx;" :style="{'color':v.state == 2 ?'red' :'#1E272E'}">{{v.assignName}}</view>
							<view style="font-weight: 500;margin:20rpx 0 30rpx 0;
font-size: 28rpx;" :style="{'color':v.state == 2 ?'red' :'#1E272E'}">任务时间：{{v.todayTime}}</view>
							<view style="font-weight: 500;
font-size: 28rpx;" :style="{'color':v.state == 2 ?'red' :' #919191'}">{{v.taskName}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-if="[0,4,7,2,8,9,10].includes(loginType)">
			<!-- 超管  0 --> <!-- 客户 4 --><!-- 品牌方 7 --><!-- 品牌方 7 -->
			<image src="https://renovationcdn.jiachuangnet.com/index/workerIndex/companyBg.png" class='bg' style="">
			</image>
			<view class="container" style="padding-bottom: 100rpx;">
				<view class="textLine" style="">
					<view>
						<view class='textTitle'>AI监控</view>
						<view>精准把控装修进度</view>
					</view>
					<view style="width: 1rpx;height: 36rpx;background-color: #d4d4d4;"></view>
					<view>
						<view class='textTitle'>智能测量</view>
						<view>CAD图精准测量</view>
					</view>
					<view style="width: 1rpx;height: 36rpx;background-color: #d4d4d4;"></view>
					<view>
						<view class='textTitle'>智能报价</view>
						<view>杜绝材料浪费</view>
					</view>
				</view>
				<view class="textLine itemContent">
					<!-- <view @click="addClick">
						<image style="width: 74rpx;height: 65rpx" src="https://renovationcdn.jiachuangnet.com/shop.png">
						</image>
						<view>一键建店</view>
					</view> -->
					<view @click="gotoManageStore" v-if="[7,10].includes(loginType)">
						<image style="width: 68rpx;height: 68rpx"
							src="https://renovationcdn.jiachuangnet.com/manage.png"></image>
						<view>店铺管理</view>
					</view>
					<view @click="storeManage" v-if="[0,4].includes(loginType)">
						<image style="width: 68rpx;height: 68rpx"
							src="https://renovationcdn.jiachuangnet.com/manage.png"></image>
						<view>店铺管理</view>
					</view>
					<view @click="jianliStoreManage" v-if="[2].includes(loginType)">
						<image style="width: 68rpx;height: 68rpx"
							src="https://renovationcdn.jiachuangnet.com/manage.png"></image>
						<view>店铺管理</view>
					</view>
					<view @click="otherPepole" v-if="[8,9].includes(loginType)">
						<image style="width: 68rpx;height: 68rpx"
							src="https://renovationcdn.jiachuangnet.com/manage.png"></image>
						<view>店铺管理</view>
					</view>
					<view @click="toPathB('videoList')">
						<image style="width: 67rpx;height: 63rpx"
							src="https://renovationcdn.jiachuangnet.com/video.png"></image>
						<view>实时监控</view>
					</view>
					<view @click="toPath('cad')">
						<image style="width: 67rpx;height: 63rpx" src="https://renovationcdn.jiachuangnet.com/cad.png">
						</image>
						<view>智能测量</view>
					</view>
				</view>
				<u-swiper height="330rpx" indicatorMode='dot' :list="bannerList" :indicator='true'></u-swiper>
				<starWorker v-if="[0,4,2,10].includes(loginType)" />
				<!-- loginType== 0 || loginType == 4 || loginType == 7|| loginType == 2|| loginType == 8|| loginType == 2|| loginType == 9"> -->
				<view v-if="[7,8,9].includes(loginType)" style="margin-top: 20rpx;">
					<view class="floor" v-if="[7,8].includes(loginType)">
						<view class="title" style="padding-bottom: 20rpx;">
							巡店
						</view>
						<view class="floor flex"
							style="flex-wrap: wrap;justify-content: space-around;margin: unset;padding: unset;">
							<view class="workItem" @click="toPathC('oLineAssessment/index?patrolType=2')">
								<image src="https://renovationcdn.jiachuangnet.com/details/work5.png" mode=""
									style="width: 60rpx;height: 60rpx;margin-bottom: 20rpx;"></image>
								<!-- <u-icon name="tags" color="#13989a" size="28"></u-icon> -->
								<text>线下考评</text>
							</view>
							<view class="workItem" @click="toPathC('spotChecks/index')">
								<image src="https://renovationcdn.jiachuangnet.com/details/work4.png" mode=""
									style="width: 60rpx;height: 60rpx;margin-bottom: 20rpx;"></image>
								<text>线下点检</text>
							</view>
							<view class="workItem" @click="toPathC('oLineAssessment/index?patrolType=1')">
								<image src="https://renovationcdn.jiachuangnet.com/details/work3.png" mode=""
									style="width: 60rpx;height: 60rpx;margin-bottom: 20rpx;"></image>
								<text>线上考评</text>
							</view>
							<view class="workItem" @click="toPathC('pictureCheck/index')">
								<image src="https://renovationcdn.jiachuangnet.com/details/work2.png" mode=""
									style="width: 60rpx;height: 60rpx;margin-bottom: 20rpx;"></image>
								<text>图片点检</text>
							</view>
							<view class="workItem" @click="toPathC('workbench/index')">
								<image src="https://renovationcdn.jiachuangnet.com/details/wokr1.png" mode=""
									style="width: 60rpx;height: 60rpx;margin-bottom: 20rpx;"></image>
								<text>工作台</text>
							</view>
						</view>
					</view>
					<view class="floor">
						<view class="title">
							我的待办
						</view>
						<view style="display: flex; flex-wrap: wrap;justify-content: space-around;">
							<view class="workItem" @click="toPathC('todo/index')">
								<text style="color: #f25f41;font-size: 30rpx;">{{toDoCount||0}}</text>
								<text>待办整改</text>
							</view>
							<view style="height: 50rpx;width: 1rpx;background-color: #f3f3f3;"
								v-if="[7,8].includes(loginType)">

							</view>
							<view class="workItem" @click="toPathC('todo/task')" v-if="[7,8].includes(loginType)">
								<text style="color: #f25f41;font-size: 30rpx;">{{taskCount||0}}</text>
								<text>待办任务</text>
							</view>
							<!-- <view style="height: 50rpx;width: 1rpx;background-color: #f3f3f3;">
								
							</view>
							<view class="workItem">
								<text style="color: #f25f41;font-size: 30rpx;">5</text>
								<text>其他</text>
							</view> -->
						</view>
					</view>
				</view>
				<!-- <view class="starTechnician">
					<view class="lineTitle">
						<view>实际案例</view>
						<u-icon name='arrow-right' size="20" color="#c9c9c9"></u-icon>
					</view>
					<view class="shopContainer" style="display: flex;justify-content: space-between;flex-wrap: wrap;">
						<view v-for="(item,index) in collaborationCaseList" style="width: 320rpx;margin-bottom: 20rpx;">
							<u-image :src="item.storeImg" radius="10" width="100%" height="240rpx"></u-image>
							<view
								style="text-align: center;font-size: 24rpx;text-align: center;font-weight: 700;padding:20rpx 0;">
								{{item.assignName}}
							</view>
						</view>
					</view>
				</view> -->
			</view>

			<!-- 项目经理 3 -->
			<!-- 监理 2 -->
			<!-- 公司管理员 1 -->
		</view>

		<!-- 专门针对供应商11 这个角色的显示 -->
		<view v-if="loginType==11" class="company">
			<image src="https://renovationcdn.jiachuangnet.com/index/workerIndex/bg.png" class='bg' style=""></image>
			<view style="position: absolute;top:0;left:25rpx;z-index: 1000;width: 700rpx;padding-bottom: 100rpx;">
				<view style="display: flex;justify-content: center;"
					:style="{'marginTop':searchBarTop + 'px','lineHeight':searchBarHeight +'px'}">
					<view class="todayTask" style="" @click="addClick">{{companyName}}</view>
					<!-- <u-icon name="arrow-down-fill"></u-icon> -->
				</view>
				<view style="margin:40rpx 0;margin-bottom:15rpx;display: flex;align-items: center;">
					<image style="width: 25rpx;height: 32rpx"
						src="https://renovationcdn.jiachuangnet.com/index/workerIndex/map.png"></image>
					<view @click="provinceShow=true" style="" class="province">{{province1||'全国'}}</view>
					<view class="workerSearch" style="">
						<image style="width: 34rpx;height: 34rpx;"
							src="https://renovationcdn.jiachuangnet.com/index/workerIndex/search.png"></image>
						<u-input @change="deChange" placeholder="请输入您想搜索的内容" style="height: 78rpx;"
							v-model="searchKey"></u-input>
					</view>
					<view v-if="false" style="margin-left: 24rpx;" @click="toPath('notice')">
						<view style="display: flex;justify-content: center">
							<image style="width: 28rpx;height: 28rpx"
								src="https://renovationcdn.jiachuangnet.com/index/workerIndex/news.png"></image>
						</view>
						<view>消息</view>
					</view>
				</view>
				<u-tabs v-if="loginType!=11" @click='changeTaskState'
					:activeStyle="{'fontSize':'28rpx','fontWeight':'700','color':'#1e272e'}"
					:inactiveStyle="{'fontSize':'28rpx','fontWeight':'500','color':'#868686'}" :lineColor='color'
					:list="statusList1" :scrollable="true" :current="currentTab"></u-tabs>
				<u-tabs v-if="loginType==11" @click='changeTaskState11'
					:activeStyle="{'fontSize':'28rpx','fontWeight':'700','color':'#1e272e'}"
					:inactiveStyle="{'fontSize':'28rpx','fontWeight':'500','color':'#868686'}" :lineColor='color'
					:list="suppierList" :scrollable="true" :current="currentTab"></u-tabs>
				<view class="listContent">
					<template v-if="!list.length">
						<view style="text-align: center;margin-top: 40rpx;">暂无数据</view>
					</template>
					<template>
						<view v-for="(v,i) in list" :key="i" class="listItem" @click="toPathCreateTask(v.assignTaskId)">
							<view class="stateTag" v-if='loginType===11'>
								<text v-if="v.supplierState == 1">待确认</text>
								<text v-if="v.supplierState == 2">待上传(预算)</text>
								<text v-if="v.supplierState == 3">待审核(预算)</text>
								<text v-if="v.supplierState == 4">待开工</text>
								<text v-if="v.supplierState == 5">进行中</text>
								<text v-if="v.supplierState == 6">待验收</text>
								<text v-if="v.supplierState == 7">待上传(结算)</text>
								<text v-if="v.supplierState == 8">待审核(结算)</text>
								<text v-if="v.supplierState == 9">已完成</text>

							</view>
							<view v-if="loginType==11">
								<view class="stateBtn btn" v-if="v.supplierState>=1"
									@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
									查看进度
								</view>
								<view class="stateBtn btn" v-if="v.supplierState == 6 || v.supplierState==9 "
									@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
									查看
								</view>
								<view class="stateBtn btn" v-if="v.isCorrection >0"
									@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
									待整改
								</view>

							</view>
							<view v-if="loginType!=11">
								<view class="stateBtn btn"
									v-if="v.state==5||(v.state==4&&(currentTab==4||currentTab==0)&&v.payFlag==1)"
									@click.stop="assignStartWork(v.assignTaskId)">
									开工
								</view>
								<view class="stateBtn btn" v-if="v.state==6||v.state == 7"
									@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
									查看进度
								</view>
								<view class="stateBtn btn" v-if="(v.state==6||v.state == 7||v.state==8)&&loginType==11"
									@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
									查看进度
								</view>
								<view class="stateBtn btn" v-if="v.state==1&&v.brandPartyId!=1"
									@click.stop="startMeasuringFn(v.assignTaskId,v.storeType,v.brandPartyId)">
									初尺测量
								</view>
								<view class="stateBtn btn" v-if="v.state==0"
									@click.stop="submitWarehouse(v.assignTaskId,v.areaId,v.brandPartyId)">
									确认
								</view>
								<!-- <view class="stateBtn btn" v-if="v.state==3||(v.state==4&&(currentTab==3||currentTab==0))&&v.payFlag==0"  @click.stop="lookSign(v.signImg||v.inputImg)">
														查看合同
													</view> -->
								<view class="stateBtn btn"
									v-if="v.state==3||(v.state==4&&(currentTab==3||currentTab==0))&&v.payFlag==0"
									@click.stop="toPathB_1(`/concractList/index?assignTaskId=${v.assignTaskId}&status=${v.state}`)">
									查看合同
								</view>
								<view class="stateBtn btn" v-if="v.state == 8||v.state==9"
									@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
									查看
								</view>
								<view class="cameraBox" style="bottom:4rpx;z-index: 10000;"
									v-if="v.state>=5||(v.state==4&&(currentTab==4||currentTab==0)&&v.payFlag==1)">
									<!-- <text @click.stop="videoSrcBindFn(v,i)"
												style="height: 100%; margin-left: 10rpx;font-size: 24rpx;color: #13989a;text-decoration: underline;">摄像头绑定</text> -->
									<text @click.stop="videoSrcBindFn(v,i)"
										style="height: 100%; margin-left: 10rpx;font-size: 26rpx;color: #13989a;text-decoration: underline;">监控绑定</text>
									<!-- <template v-if="v.serialNumber">
												<text :key="cameraIndex"
													@click.stop="viewVideoFn(cameraUrl,v.assignName,cameraIndex+1)"
													v-for="(cameraUrl,cameraIndex) in v.serialNumber"
													style="height: 100%; margin-left: 10rpx;font-size: 24rpx;color: #13989a;text-decoration: underline;">摄像头{{cameraIndex+1}}</text>
											</template> -->

									<text v-if="v.serialNumber">
										<text :key="cameraIndex"
											@click.stop="viewVideoFn(cameraUrl,v.assignName,cameraIndex+1)"
											v-for="(cameraUrl,cameraIndex) in v.serialNumber"
											style="height: 100%; margin-left: 10rpx;font-size: 28rpx;color: #13989a;text-decoration: underline;">监控{{cameraIndex+1}}</text>
									</text>


								</view>
							</view>
							<image v-if="v.state == 7" src="https://renovationcdn.jiachuangnet.com/index/yiyuqi.png"
								style="width: 178rpx;height:154rpx;position: absolute;top:10rpx;left:0rpx;z-index:10000">
							</image>
							<view style="position: relative;">
								<image :src="v.storeImg" v-if="v.storeImg"
									style="width:210rpx;height: 220rpx;border-radius: 20rpx;"></image>
								<image v-else src="https://renovationcdn.jiachuangnet.com/index/workerIndex/shop.png"
									style="width:210rpx;height: 220rpx;"></image>
								<view class="stateTag1" v-if="v.brandPartyId==1&&v.storeType==1">
									<text>普通店</text>

								</view>
								<view class="stateTag2" v-if="v.brandPartyId==2&&v.storeType==1">
									<text>加盟店</text>
								</view>
								<view class="stateTag3" v-if="v.storeType==2">
									<text>旗舰店</text>
								</view>
							</view>
							<view style="width:calc(100% - 230rpx);margin-left:20rpx;">
								<view style="font-weight: bold;width: 80%;overflow:hidden;white-space: nowrap;text-overflow:ellipsis;
						font-size: 36rpx;" :style="{'color':v.state == 7 ?'red' :'#1E272E'}">{{v.assignName}}</view>
								<view style="font-weight: 500;margin:20rpx 0 10rpx 0;
						font-size: 28rpx;" :style="{'color':v.state == 7 ?'red' :'#1E272E'}" v-if="v.state>5&&v.startTime">
									开始时间：{{v.startTime.split(' ')[0]}}</view>
								<view style="font-weight: 500;margin:20rpx 0 10rpx 0;
													font-size: 28rpx;" v-if="(v.state<6)&&v.createTime">发布时间：{{v.createTime.split(' ')[0]}}</view>
								<view style="font-weight: 500;margin:10rpx 0 10rpx 0;
													font-size: 28rpx;color: 1E272E;" v-if="v.confirmTime&&(v.state>7)">完成时间：{{v.confirmTime.split(' ')[0]}}
								</view>
								<!-- <view style="font-weight: 500;margin:10rpx 0 10rpx 0;color: #f56c6c;
													font-size: 28rpx;"  v-if="v.state==4&&v.payFlag==1">该付款金额达到80%可开工</view> -->

								<!-- <view class="contract" v-if="v.state==5">
														待开工
													</view>
													<view class="contract" v-if="v.state==0">
														确认
													</view>
													<view class="contract" v-if="v.state==1">
														开始测量
													</view> -->
								<view class="contract flex" style="justify-content: space-between;">

									<!-- <view class="contract" v-if="v.state==3||v.state==4||v.state==2">
															¥{{v.contractMoney}} <text style="color: #13989a;padding-left: 20rpx;">[已付¥{{v.contractPayMoney}}]</text>
														</view> -->
									<view class="contract" v-if="(v.state==6||v.state==8)&&loginType!=11">
										已完成{{v.progress}}
									</view>
									<view style="color:red ;" v-if="v.state==7&&loginType!=11">
										已完成{{v.progress}}
									</view>
									<!-- <view  style="color:#13989a ;text-decoration: underline;" v-if="!v.signImg&&!v.inputImg" @click="uploadFile(v)">
															上传合同
														</view>
														<view  style="color:#13989a ;text-decoration: underline;" v-if="!v.signImg&&v.inputImg" @click="uploadFile(v)">
															重传合同
														</view> -->
									<!-- <view  style="color:#13989a ;text-decoration: underline;"  v-if="v.state==6||v.state==7||v.state==5||(v.state==4&&(currentTab==4||currentTab==0)&&v.payFlag==1)" @click.stop="lookSign(v.signImg||v.inputImg)" >
															查看合同
														</view> -->
									<view style="color:#13989a ;text-decoration: underline;"
										v-if="v.state==6||v.state==7||v.state==5||(v.state==4&&(currentTab==4||currentTab==0)&&v.payFlag==1)"
										@click.stop="toPathB_1(`/concractList/index?assignTaskId=${v.assignTaskId}&status=${v.state}`)">
										查看合同
									</view>
									<!-- &&v.projectUserId -->
									<view style="color:#13989a ;text-decoration: underline;font-size: 30rpx;"
										v-if="loginType==1&&!v.projectUserId"
										@click.stop="projectUserShowFn(v.assignTaskId)">
										选择项目经理
									</view>
									<!-- <view  style="color:#13989a ;text-decoration: underline;" v-if="!v.signImg&&v.inputImg" @click="signContract(v.inputImg,v.assignTaskId,v.imgUrl,v.contractId)" >
															签约合同
														</view> -->
								</view>

							</view>
						</view>
					</template>

				</view>
			</view>
			<!-- 对任务条件搜索 -->
			<u-picker :show="showRange" :columns="columns" @cancel="showRange=false"
				@confirm="searchHandler"></u-picker>
		</view>



		<!-- 1 和 3 角色 （本来有11这个角色的 现在单独把11角色移出来） -->
		<view v-if=" loginType==1 || loginType==3" class="company">
			<image src="https://renovationcdn.jiachuangnet.com/index/workerIndex/bg.png" class='bg' style=""></image>
			<view style="position: absolute;top:0;left:25rpx;z-index: 1000;width: 700rpx;padding-bottom: 100rpx;">
				<view style="display: flex;justify-content: center;"
					:style="{'marginTop':searchBarTop + 'px','lineHeight':searchBarHeight +'px'}">
					<view class="todayTask" style="" @click="addClick">{{companyName}}</view>
					<!-- <u-icon name="arrow-down-fill"></u-icon> -->
				</view>
				<view style="margin:40rpx 0;margin-bottom:15rpx;display: flex;align-items: center;">
					<image style="width: 25rpx;height: 32rpx"
						src="https://renovationcdn.jiachuangnet.com/index/workerIndex/map.png"></image>
					<view @click="provinceShow=true" style="" class="province">{{province1||'全国'}}</view>
					<view class="workerSearch" style="">
						<image style="width: 34rpx;height: 34rpx;"
							src="https://renovationcdn.jiachuangnet.com/index/workerIndex/search.png"></image>
						<u-input @change="deChange" placeholder="请输入您想搜索的内容" style="height: 78rpx;"
							v-model="searchKey"></u-input>
					</view>
					<view v-if="false" style="margin-left: 24rpx;" @click="toPath('notice')">
						<view style="display: flex;justify-content: center">
							<image style="width: 28rpx;height: 28rpx"
								src="https://renovationcdn.jiachuangnet.com/index/workerIndex/news.png"></image>
						</view>
						<view>消息</view>
					</view>
				</view>
				<u-tabs v-if="loginType!=11" @click='changeTaskState'
					:activeStyle="{'fontSize':'28rpx','fontWeight':'700','color':'#1e272e'}"
					:inactiveStyle="{'fontSize':'28rpx','fontWeight':'500','color':'#868686'}" :lineColor='color'
					:list="statusList1" :scrollable="true" :current="currentTab"></u-tabs>

				<view class="listContent">
					<view v-for="(v,i) in list" :key="i" class="listItem" @click="toPathCreateTask(v.assignTaskId)">
						<view class="stateTag" v-if='loginType!=11'>
							<text v-if="v.state == 0">待确认</text>
							<text v-if="v.state == 1">待测量</text>
							<text v-if="v.state == 2">待上传</text>
							<text v-if="v.state == 3">待付款</text>
							<text v-if="v.state == 4">部分付款</text>
							<text v-if="v.state == 5">待开工</text>
							<text v-if="v.state == 6">进行中</text>
							<text v-if="v.state == 8">待验收</text>
							<text v-if="v.state == 9">已完工</text>
							<text v-if="v.state == 7">已逾期</text>
						</view>
						<view v-if="loginType==11">
							<view class="stateBtn btn" v-if="v.state>=6"
								@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
								查看进度
							</view>
							<view class="stateBtn btn" v-if="v.state == 8||v.state==9 "
								@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
								查看
							</view>
							<view class="stateBtn btn" v-if="v.isCorrection >0"
								@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
								待整改
							</view>
						</view>
						<view v-if="loginType!=11">

							<!-- <view class="stateBtn btn"
								v-if="v.state==5||(v.state==4&&(currentTab==4||currentTab==0)&&v.payFlag==1)"
								@click.stop="assignStartWork(v.assignTaskId)">
								开工
							</view> 注释了 放到了任务进度页面-->
							<!-- v-if="v.state==6||v.state == 7" -->
							<view class="stateBtn btn" @click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
								查看进度
							</view>

							<view class="stateBtn btn" v-if="v.state==1&&v.brandPartyId!=1"
								@click.stop="startMeasuringFn(v.assignTaskId,v.storeType,v.brandPartyId)">
								初尺测量
							</view>
							<!-- <view class="stateBtn btn" v-if="v.state==0"
								@click.stop="submitWarehouse(v.assignTaskId,v.areaId,v.brandPartyId)">
								确认
							</view>  注释了 放到了任务进度页面-->

							<!-- <view class="stateBtn btn" v-if="v.state==3||(v.state==4&&(currentTab==3||currentTab==0))&&v.payFlag==0"  @click.stop="lookSign(v.signImg||v.inputImg)">
											查看合同
										</view> -->
							<view class="stateBtn btn"
								v-if="v.state==3||(v.state==4&&(currentTab==3||currentTab==0))&&v.payFlag==0"
								@click.stop="toPathB_1(`/concractList/index?assignTaskId=${v.assignTaskId}&status=${v.state}`)">
								查看合同
							</view>
							<view class="stateBtn btn" v-if="v.state == 8||v.state==9"
								@click.stop="taskProgress(v.assignTaskId,v.brandPartyId)">
								查看
							</view>
							<view class="cameraBox" style="bottom:4rpx;z-index: 10000;"
								v-if="v.state>=5||(v.state==4&&(currentTab==4||currentTab==0)&&v.payFlag==1)">
								<!-- <text @click.stop="videoSrcBindFn(v,i)"
									style="height: 100%; margin-left: 10rpx;font-size: 24rpx;color: #13989a;text-decoration: underline;">摄像头绑定</text> -->
								<text @click.stop="videoSrcBindFn(v,i)"
									style="height: 100%; margin-left: 10rpx;font-size: 26rpx;color: #13989a;text-decoration: underline;">监控绑定</text>
								<!-- <template v-if="v.serialNumber">
									<text :key="cameraIndex"
										@click.stop="viewVideoFn(cameraUrl,v.assignName,cameraIndex+1)"
										v-for="(cameraUrl,cameraIndex) in v.serialNumber"
										style="height: 100%; margin-left: 10rpx;font-size: 24rpx;color: #13989a;text-decoration: underline;">摄像头{{cameraIndex+1}}</text>
								</template> -->

								<text v-if="v.serialNumber">
									<text :key="cameraIndex"
										@click.stop="viewVideoFn(cameraUrl,v.assignName,cameraIndex+1)"
										v-for="(cameraUrl,cameraIndex) in v.serialNumber"
										style="height: 100%; margin-left: 10rpx;font-size: 28rpx;color: #13989a;text-decoration: underline;">监控{{cameraIndex+1}}</text>
								</text>


							</view>
						</view>
						<image v-if="v.state == 7" src="https://renovationcdn.jiachuangnet.com/index/yiyuqi.png"
							style="width: 178rpx;height:154rpx;position: absolute;top:10rpx;left:0rpx;z-index:10000">
						</image>
						<view style="position: relative;">
							<image :src="v.storeImg" v-if="v.storeImg"
								style="width:210rpx;height: 220rpx;border-radius: 20rpx;"></image>
							<image v-else src="https://renovationcdn.jiachuangnet.com/index/workerIndex/shop.png"
								style="width:210rpx;height: 220rpx;"></image>
							<view class="stateTag1" v-if="v.brandPartyId==1&&v.storeType==1">
								<text>普通店</text>

							</view>
							<view class="stateTag2" v-if="v.brandPartyId==2&&v.storeType==1">
								<text>加盟店</text>
							</view>
							<view class="stateTag3" v-if="v.storeType==2">
								<text>旗舰店</text>
							</view>
						</view>
						<view style="width:calc(100% - 230rpx);margin-left:20rpx;">
							<view style="font-weight: bold;width: 80%;overflow:hidden;white-space: nowrap;text-overflow:ellipsis;
			font-size: 36rpx;" :style="{'color':v.state == 7 ?'red' :'#1E272E'}">{{v.assignName}}</view>
							<view style="font-weight: 500;margin:20rpx 0 10rpx 0;
			font-size: 28rpx;" :style="{'color':v.state == 7 ?'red' :'#1E272E'}" v-if="v.state>5&&v.startTime">
								开始时间：{{v.startTime.split(' ')[0]}}</view>
							<view style="font-weight: 500;margin:20rpx 0 10rpx 0;
										font-size: 28rpx;" v-if="(v.state<6)&&v.createTime">发布时间：{{v.createTime.split(' ')[0]}}</view>
							<view style="font-weight: 500;margin:10rpx 0 10rpx 0;
										font-size: 28rpx;color: 1E272E;" v-if="v.confirmTime&&(v.state>7)">完成时间：{{v.confirmTime.split(' ')[0]}}
							</view>
							<!-- <view style="font-weight: 500;margin:10rpx 0 10rpx 0;color: #f56c6c;
										font-size: 28rpx;"  v-if="v.state==4&&v.payFlag==1">该付款金额达到80%可开工</view> -->

							<!-- <view class="contract" v-if="v.state==5">
											待开工
										</view>
										<view class="contract" v-if="v.state==0">
											确认
										</view>
										<view class="contract" v-if="v.state==1">
											开始测量
										</view> -->
							<view class="contract flex" style="justify-content: space-between;">

								<!-- <view class="contract" v-if="v.state==3||v.state==4||v.state==2">
												¥{{v.contractMoney}} <text style="color: #13989a;padding-left: 20rpx;">[已付¥{{v.contractPayMoney}}]</text>
											</view> -->
								<view class="contract" v-if="(v.state==6||v.state==8)&&loginType!=11">
									已完成{{v.progress}}
								</view>
								<view style="color:red ;" v-if="v.state==7&&loginType!=11">
									已完成{{v.progress}}
								</view>
								<!-- <view  style="color:#13989a ;text-decoration: underline;" v-if="!v.signImg&&!v.inputImg" @click="uploadFile(v)">
												上传合同
											</view>
											<view  style="color:#13989a ;text-decoration: underline;" v-if="!v.signImg&&v.inputImg" @click="uploadFile(v)">
												重传合同
											</view> -->
								<!-- <view  style="color:#13989a ;text-decoration: underline;"  v-if="v.state==6||v.state==7||v.state==5||(v.state==4&&(currentTab==4||currentTab==0)&&v.payFlag==1)" @click.stop="lookSign(v.signImg||v.inputImg)" >
												查看合同
											</view> -->
								<view style="color:#13989a ;text-decoration: underline;"
									v-if="v.state==6||v.state==7||v.state==5||(v.state==4&&(currentTab==4||currentTab==0)&&v.payFlag==1)"
									@click.stop="toPathB_1(`/concractList/index?assignTaskId=${v.assignTaskId}&status=${v.state}`)">
									查看合同
								</view>
								<!-- &&v.projectUserId -->
								<view style="color:#13989a ;text-decoration: underline;font-size: 30rpx;"
									v-if="loginType==1&&!v.projectUserId"
									@click.stop="projectUserShowFn(v.assignTaskId)">
									选择项目经理
								</view>
								<!-- <view  style="color:#13989a ;text-decoration: underline;" v-if="!v.signImg&&v.inputImg" @click="signContract(v.inputImg,v.assignTaskId,v.imgUrl,v.contractId)" >
												签约合同
											</view> -->
							</view>

						</view>
					</view>
				</view>
			</view>
			<!-- 对任务条件搜索 -->
			<u-picker :show="showRange" :columns="columns" @cancel="showRange=false"
				@confirm="searchHandler"></u-picker>
		</view>
		<u-popup :show="videoSrcBind" @close="videoSrcBindClose" round="10" mode="bottom">
			<view class="uploadForm" style="padding-bottom: 200rpx;">
				<view class="upload_title">
					<text>绑定监控</text>
				</view>
				<view class="flex alignItem bewteen" style="margin: 50rpx 0;" v-for="(item,index) in serialNumber"
					:key="index">
					<view class="label" style="width: 200rpx;">{{index+1}}. 监控序列号: </view>
					<view class="val" style="display: flex;">
						<view style="flex: 1;border: 1px solid #bcbcbc; border-radius: 4px;margin-right: 10rpx;">
							<u-input v-model="serialNumber[index]" placeholder="请输入监控序列号"></u-input>
						</view>
						<view style="width: 150rpx;display: flex;justify-content: space-around;">
							<u-icon name="plus-circle" color="#13989a" size="28" @click="plusClick"></u-icon>
							<u-icon name="minus-circle" color="#f56c6c" size="28" @click="minusClick(index)"></u-icon>
						</view>
					</view>
				</view>
				<u-button type="primary" text="绑定" @click="onSubmit2"></u-button>
			</view>
		</u-popup>
		<u-popup :show="provinceShow" mode="left" @close="close">
			<view style="width: 400rpx;">
				<view style="padding-top: 100rpx;font-weight: 700;font-size: 28rpx;">
					请选择店铺所在城市
				</view>
				<view style="overflow-y: scroll;max-height: 80vh;margin:20rpx 0;">
					<u-radio-group iconPlacement="right" v-model="province" placement="column">
						<u-radio :activeColor='color' shape='square'
							:customStyle="{ borderBottom:'1rpx solid #eee',padding:'10px'}"
							v-for="(item, index) in provinceColumns" :key="index" :label="item.name" :name="item.name">
						</u-radio>
					</u-radio-group>
				</view>
				<view style="width:300rpx;margin:0 auto">
					<u-button :color='color' @click="searchProvince">查询</u-button>
				</view>
			</view>
		</u-popup>
		<u-popup :show="timePopShow" @close="timePopShow=false" round="10" mode="top">
			<view class="overdueForm">
				<view class="flex alignItem bewteen" style="margin-bottom: 50rpx;" @click="timeShow=true">
					<view class="label" style="width:150rpx">查找时间：</view>
					<view class="val">
						<u-input v-model="time1" :disabled="true" placeholder="请选择查找时间"></u-input>
					</view>
				</view>
				<view class="flex" style="align-items: center;">
					<view style="margin: 10rpx;flex: 1;">
						<u-button type="primary" plain text="全部" @click="onTimeSubmit('全部')"></u-button>
					</view>
					<view style="margin: 10rpx;flex: 1;">
						<u-button type="primary" plain text="今日" @click="onTimeSubmit('今日')"></u-button>
					</view>
					<!-- <u-button type="primary"  text="确认" @click="onTimeSubmit" shape="circle" ></u-button> -->
				</view>
			</view>

		</u-popup>
		<u-popup :show="warehouseShow" @close="warehouseShow=false" round="10" mode="center">
			<view class="overdueForm" style="padding-top: 20rpx;">
				<view style="text-align: center;font-size: 30rpx;margin-bottom: 50rpx;">
					请确认店铺发货仓库
				</view>
				<view class="flex alignItem bewteen" style="margin-bottom: 50rpx;width: 65vw;">
					<view class="label" style="width:160rpx">发货仓库：</view>
					<uni-data-select style="width: 80%;" v-model="warehouseValue" :localdata="warehouseRange"
						@change="change"></uni-data-select>
				</view>
				<view class="flex">
					<view style="margin-right: 20rpx;flex: 1;">
						<u-button style="height: 88rpx;" @click="warehouseShow=false">取消</u-button>
					</view>
					<view style="flex: 1;">
						<u-button style="height: 88rpx;" color='#13989a'
							@click="updateConfirmTaskStatusDto">确认</u-button>
					</view>
				</view>
			</view>
		</u-popup>
		<u-popup :show="projectUserShow" @close="projectUserShow=false" round="10" mode="center">
			<view class="overdueForm" style="padding-top: 20rpx;">
				<view style="text-align: center;font-size: 30rpx;margin-bottom: 50rpx;">
					请确选择店铺项目经理
				</view>
				<view class="flex alignItem bewteen" style="margin-bottom: 50rpx;width: 65vw;">
					<view class="label" style="width:160rpx">项目经理：</view>
					<uni-data-select style="width: 300rpx;" v-model="jlValue" :localdata="jlRange"
						@change="change"></uni-data-select>
				</view>
				<view class="flex">
					<view style="margin-right: 20rpx;flex: 1;">
						<u-button style="height: 88rpx;" @click="projectUserShow=false">取消</u-button>
					</view>
					<view style="flex: 1;">
						<u-button style="height: 88rpx;" color='#13989a' @click="projectUserFn">确认</u-button>
					</view>
				</view>
			</view>
		</u-popup>
		<u-popup :show="viewVideoShow" @close="viewVideoClose" round="10" mode="center">
			<view class="viewVideo">
				<view style="text-align: center;" v-if="currentSerialMsg&&currentSerialMsg.storeName">
					{{currentSerialMsg.storeName}}
				</view>
				<view class="viewVideo_v">
					<view style="width: 100%;height: 100%;" v-if="!videoSrc||videoStatus==-1">
						<u-empty icon="https://renovationcdn.jiachuangnet.com/shipin.png"
							style="width: 100%;height: 100%;" :text="textVideo">
						</u-empty>
					</view>
					<video v-if="videoSrc&&videoStatus==1&&viewVideoShow" id="myVideo"
						style="width: 100%;height: 450rpx;border-radius:20rpx;" object-fit='cover' :src='videoSrc'
						:autoplay='false' codec="software" loop="true" @error='videoError'></video>
					<!-- #ifdef MP-WEIXIN -->
					<!-- <video v-if="videoSrc&&videoStatus==1&&viewVideoShow" id="myVideo"
						style="width: 100%;height: 450rpx;border-radius:20rpx;" object-fit='cover' :src='videoSrc'
						:autoplay='true'   codec="software" loop="true" @error='videoError' ></video> -->
					<!-- #endif -->
					<!-- #ifdef APP -->
					<!-- src='https://assets.mixkit.co/video-templates/41/mixkit-41-360.mp4' -->
					<!-- <video id="myVideo" :src="videoSrc"
								 @error="videoErrorCallback" autoplay controls v-if="videoSrc&&videoStatus==1&&viewVideoShow" style="width: 100%;height: 450rpx"></video> -->
					<!-- <view style="height: 450rpx;width: 100%;" v-html="video"></view>
					-->
					<!-- #endif -->
				</view>
				<view class="video_msg" style="margin-bottom: 20rpx;" v-if="currentSerialMsg">
					<view v-if="currentSerialMsg.videoName">
						{{currentSerialMsg.videoName}}
					</view>
					<view v-if="currentSerialMsg.videoName">
						序列号：{{currentSerialMsg.serialNumber}}
					</view>
					<view>
						状态：{{videoStatus==1?'在线':'不在线'}}
					</view>
				</view>
				<u-button color="#13989a" text="关闭" @click="viewVideoClose"></u-button>
			</view>

		</u-popup>
		<u-datetime-picker :show="timeShow" v-model="time" :formatter="formatter" mode="date" closeOnClickOverlay
			@confirm="timeConfirm" @cancel="timeCancel" @close="timeClose"></u-datetime-picker>
		<newTabbar v-if="tabbarShow" style="position: fixed;top:0;bottom:0;z-index:10000000" :index='0'
			:tabbarList="tabbarList"></newTabbar>
	</view>
</template>
<script>
	let app = getApp();
	import starWorker from '@/components/starworker/index.vue'
	import rayVideo from '@/components/rayVideo/index.vue'
	import newTabbar from '@/components/newTabbar/index.vue'
	import systemConfig from '../../api/systemConfig.js'

	import {
		numberToChanie
	} from '../../util.js'
	import cellGroup from '../../uni_modules/uview-ui/libs/config/props/cellGroup.js';
	export default {
		components: {
			starWorker,
			rayVideo,
			newTabbar
		},
		data() {
			return {
				tabbarList: [{
						'text': '首页',
						'path': 'settled',
						'activeIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/indexed.png',
						'inactiveIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/index.png',
						'name': '首页'
					},
					{
						'text': '我的',
						'path': 'mine',
						'activeIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/mined.png',
						'inactiveIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/mine.png',
						'name': '我的'
					}
				],
				warehouseShow: false,
				projectUserShow: false,
				jlRange: [],
				jlValue: null,
				projectUserAssignId: 0,
				brandPartyId: null,
				warehouseValue: null,
				tabbarShow: false,
				imageValue: null,
				videoSrc: '',
				videoStatus: 0,
				viewVideoShow: false,
				currentSerialMsg: null,
				videoSrcBindIndex: 0,
				videoLoad: 0,
				assignTaskId: 0,
				serialNumber: [],
				videoSrcBind: false,
				timeShow: false,
				color: app.globalData.defaultColor,
				statusHeight: app.globalData.statusHeight,
				loginType: null,
				statusList: [{
						'name': '全部',
						'value': '',
						badge: {
							value: 5,
						}
					},
					{
						'name': '待开始',
						'value': 0,
						badge: {
							value: 5,
						}
					},
					{
						'name': '进行中',
						'value': 1,
						badge: {
							value: 5,
						}
					},
					{
						'name': '已逾期',
						'value': 2,
						badge: {
							value: 5,
						}
					},
					{
						'name': '已完成',
						'value': 3,
						badge: {
							value: 5,
						}
					},

				],
				time1: null,
				timeText: '今日任务',
				time: Number(new Date()),
				provinceShow: false,
				starTechnicianList: [], //技工列表
				collaborationCaseList: [], //合作店铺
				statusNum: null,
				storeList: [], //店铺列表
				bannerList: [
					'https://renovationcdn.jiachuangnet.com/banner-4.png',
					'https://renovationcdn.jiachuangnet.com/banner-5.png',
					'https://renovationcdn.jiachuangnet.com/banner-6.png'
				],

				searchBarTop: 34, //状态栏高度
				searchBarHeight: 40, //胶囊高度
				province: '全国',
				keyword: '',
				provinceColumns: [{
						name: '全国'
					},
					{
						name: '北京市'
					},
					{
						name: '天津市'
					},
					{
						name: '河北省'
					},
					{
						name: '山西省'
					},
					{
						name: '上海市'
					},
					{
						name: '山东省'
					},
					{
						name: '河南省'
					},
					{
						name: '湖北省'
					},
					{
						name: '湖南省'
					},
					{
						name: '广东省'
					},
					{
						name: '广西壮族自治区'
					},
					{
						name: '海南省'
					},
					{
						name: '重庆市'
					},
					{
						name: '四川省'
					},
					{
						name: '贵州省'
					},
					{
						name: '云南省'
					},
					{
						name: '陕西省'
					},


				],
				// renovation
				province1: null, ///
				toDoCount: 0,
				taskCount: 0,
				warehouseRange: [],
				taskState: null,
				textVideo: '',
				warehouseShowIsAssignId: 0,
				companyName: '',
				statusList1: [],
				suppierList: [],
				currentTask: 0,
				pageNumber: 1,
				pageSize: 20,
				total: 1,
				list: [],
				status: '',
				isLogin: '',
				timePopShow: false,
				showRange: false,
				showCompanyName: false,
				companyName: null,
				companyId: null,
				columns1: [],
				companyList: null,
				columns: [
					[
						"全国", "北京市", "天津市", "河北省", "山西省", "内蒙古自治区", "辽宁省",
						"吉林省", "黑龙江省", "上海市", "江苏省", "浙江省", "安徽省",
						"福建省", "江西省", "山东省", "河南省", "湖北省", "湖南省",
						"广东省", "广西壮族自治区", "海南省", "重庆市", "四川省",
						"贵州省", "云南省", "西藏自治区", "陕西省", "甘肃省", "青海省",
						"宁夏回族自治区", "新疆维吾尔自治区", "香港特别行政区",
						"澳门特别行政区", "台湾省"
					]
				],
				searchKey: '',
				currentTab: 0,
			}
		},
		onShareAppMessage(res) {
			return {
				title: '速工装装修',
				path: '/pages/settled/index',
			}
		},
		onReady() {
			// #ifndef MP-ALIPAY
			this.videoContext = uni.createVideoContext('myVideo')
			// #endif
		},
		onLoad() {
			if (uni.getStorageSync('iscontract') == 1) {
				uni.showLoading({
					title: '合同上传中...'
				})
			}


			// #ifdef MP-WEIXIN
			let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
			//获取胶囊对上高度
			this.searchBarTop = menuButtonInfo.top;
			//获取胶囊高度
			this.searchBarHeight = menuButtonInfo.height;
			// #endif

			uni.setStorageSync('isLogin', 'yes')
		},
		// onPullDownRefresh() {
		// 	this.pageNumber=1
		// 	this.list=[]
		// 	this.getTaskList()
		// },
		onShow() {
			const timeFormat = uni.$u.timeFormat;
			this.time1 = timeFormat(new Date(), 'yyyy-mm-dd')
			this.statusNum = null
			switch (this.currentTab) {
				case 0:
					this.taskState = null
					break;
				case 1:
					this.taskState = 0
					break;
				case 2:
					this.taskState = 1
					break;
				case 3:
					this.taskState = 2
					break;
				case 4:
					this.taskState = 5
					break;
				case 5:
					this.taskState = 6
					break;

				case 6:
					this.taskState = 9
					break;

				case 7:
					this.taskState = 7
					break;
				default:
					this.taskState = null
			}
			this.getUserInfo();

			this.pageNumber = 1;
			const worker = {
				'text': '人才库',
				'path': 'talentPool',
				'activeIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/worked.png',
				'inactiveIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/worker.png',
				'name': '人才库'
			}
			const shop = {
				'text': '店铺管理',
				'path': 'manageStore',
				'activeIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/jiankonged.png',
				'inactiveIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/jiankong.png',
				'name': '店铺管理'
			}
			const jianliStoreManage = {
				'text': '店铺管理',
				'path': 'jianliStoreManage',
				'activeIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/jiankonged.png',
				'inactiveIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/jiankong.png',
				'name': '店铺管理'
			}
			const shopmanager = {
				'text': '店铺管理',
				'path': 'storeManage',
				'activeIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/jiankonged.png',
				'inactiveIcon': 'https://renovationcdn.jiachuangnet.com/tabbarIcon/jiankong.png',
				'name': '店铺管理'
			}
			uni.getStorage({
				key: 'loginType',
				success: (res) => {

					const loginType = res.data;
					if (loginType === 0 || loginType === 2 || loginType === 7 || loginType === 10) {
						//  监理 
						if (loginType === 2) {
							this.tabbarList.splice(1, 0, jianliStoreManage);
						} else {
							// 超管  品排方
							this.tabbarList.splice(1, 0, shop);
						}
						this.tabbarList.splice(2, 0, worker);
					}
					if (loginType === 1) {
						// 装修公司管理员
						this.tabbarList.splice(1, 0, worker);
					}
					if (loginType === 4) {
						//  加盟商
						this.tabbarList.splice(1, 0, shopmanager);
					}
					if (loginType === 3) {
						// 4项目经理
						this.tabbarList.splice(1, 0, worker);
					}
					this.tabbarShow = true;
				}
			})



			this.storeList = []
			this.list = []
		},
		filters: {
			numberToChanieFilter(num) {
				return numberToChanie(num)
			}
		},
		onReachBottom() {
			this.pageNumber++
			if (this.loginType == 0 || this.loginType == 4) {

			} else if (this.loginType == 1 || this.loginType == 3 || this.loginType == 11) {
				this.getTaskList()
			} else if (this.loginType == 2) {
				//
			} else if (this.loginType == 6) {
				this.search();
			}

		},
		onHide() {
			this.tabbarList = this.$options.data(this).tabbarList
		},
		methods: {
			videoErrorCallback: function(e) {
				uni.showModal({
					content: e.target.errMsg,
					showCancel: false
				})
			},
			getRandomColor: function() {
				const rgb = []
				for (let i = 0; i < 3; ++i) {
					let color = Math.floor(Math.random() * 256).toString(16)
					color = color.length == 1 ? '0' + color : color
					rgb.push(color)
				}
				return '#' + rgb.join('')
			},
			getInspectionTaskCount() {
				uni.$u.http.get('/inspectionTask/getInspectionTaskCount').then(res => {
					this.taskCount = res
				})
			},
			getTodoCount() {
				uni.$u.http.post('/patrol/getTodoCount', {

				}).then(res => {
					this.toDoCount = res
				})
			},
			toPathC(url) {
				uni.navigateTo({
					url: `/packageC/pages/${url}`
				})
			},
			projectUserFn() {
				uni.$u.http.post('/assign/updateBindProjectUserId', {
					projectUserId: this.jlValue,
					assignTaskId: this.projectUserAssignId
				}).then(res => {
					if (res) {
						uni.showToast({
							title: '确认成功',
							duration: 1000,
							mask: true,
							success: () => {
								setTimeout(() => {
									this.pageNumber = 1
									this.list = [];
									this.getTaskList()
									this.projectUserShow = false,
										this.jlValue = null
								}, 1000)
							}
						});

					}
				})
			},
			changeCompanyId(e) {
				uni.$u.http.get('/company/getManagerList', {
					params: {
						companyId: e,
					}
				}).then(res => {
					if (res) {
						this.jlRange = res.map(item => {
							return {
								value: item.userId,
								text: item.userName
							}
						})
					}
				})

			},
			getAreaList(brandPartyId) {
				uni.$u.http.get('/assign/getAreaList', {
					params: {
						brandPartyId
					}
				}).then(res => {
					console.log(res, '获取仓库列表')
					if (res) {
						this.warehouseRange = res.map((item, index) => {
							return {
								value: item.areaId,
								text: item.areaName
							}
						})
					}
				})
			},
			stopVideo() {
				const video = uni.createVideoContext("myVideo", this);
				if (video) {
					video.pause(); // 暂停视频
					video.stop(); // 停止播放
				}
			},

			toPath(url) {
				// /pages/cad/index
				// console.log('url', url);
				uni.navigateTo({
					url: `/pages/${url}/index`
				})
				// uni.navigateTo({
				// 	url:`/packageA/pages/${url}/index`
				// })
			},
			toPathB(url) {
				uni.navigateTo({
					url: `/packageB/pages/${url}/index`
				})
			},
			toPathB_1(url) {
				uni.navigateTo({
					url: `/packageB/pages${url}`
				})
			},
			toPathCreateTask(assignTaskId) {
				uni.navigateTo({
					url: `/packageB/pages/createTask1/index?assignTaskId=${assignTaskId}`
				})
			},
			startMeasuringFn(assignTaskId, storeType, brandPartyId) {
				uni.navigateTo({
					url: `/packageA/pages/cad/index?id=${assignTaskId}&storeType=${storeType}&isFirst=1&brandPartyId=${brandPartyId}`
				})
			},
			submitWarehouse(assignTaskId, warehouseValue, brandPartyId) {
				this.warehouseShow = true
				this.warehouseShowIsAssignId = assignTaskId
				this.warehouseValue = warehouseValue
				this.getAreaList(brandPartyId)
			},
			projectUserShowFn(assignTaskId) {
				console.log(assignTaskId)
				this.projectUserShow = true
				this.projectUserAssignId = assignTaskId
			},
			updateConfirmTaskStatusDto() {
				if (this.warehouseValue) {
					uni.showModal({
						title: '提示:',
						content: '确认后无法修改',
						success: (res) => {
							if (res.confirm) {
								uni.$u.http.post('/assign/updateAreaId', {
									assignTaskId: this.warehouseShowIsAssignId,
									areaId: this.warehouseValue
								}).then(res => {
									if (res) {
										uni.$u.http.post('/assign/updateConfirmTaskStatusDto', {
											assignTaskId: this.warehouseShowIsAssignId,
											status: 1
										}).then(res => {
											if (res) {
												uni.showToast({
													title: '确认成功',
													duration: 1000,
													mask: true,
													success: () => {
														setTimeout(() => {
															this.pageNumber =
																1
															this.list = [];
															this.getTaskList()
															this.warehouseShow =
																false
														}, 1000)
													}
												});
											}
										})
									}
								})
							} else if (res.cancel) {
								uni.$u.toast('取消确认 :)');
							}

						}
					})
				} else {
					uni.$u.toast('请选择仓库 :)');
				}
			},
			gotoManageStore() {
				if (this.loginType == 7 || this.loginType == 10) {
					uni.navigateTo({
						url: `/pages/manageStore/index`
					})
				}

			},
			lookSign(url) {
				if (url) {
					uni.showLoading({
						title: '合同下载中...'
					})
					uni.downloadFile({
						url: `https://${url}`,
						success: function(res) {
							var filePath = res.tempFilePath;
							uni.hideLoading();
							uni.openDocument({
								filePath: filePath,
								showMenu: true,
								success: function(res) {
									console.log('打开文档成功');
								}
							});
						},
						fail: (res) => {
							console.log(res)
							uni.hideLoading();
							uni.$u.toast('合同下载失败,请联系管理员 :)');
						}
					});
				} else {
					uni.$u.toast('合同未上传');
				}

			},
			signContract(url, assignTaskId, imgUrl, contractId) {
				uni.navigateTo({
					url: `/pages/contract/index?url=${url}&assignTaskId=${assignTaskId}&imgUrl=${imgUrl}&contractId=${contractId}`
				})
			},
			readFile(res) {
				console.log('文件内容', res)
			},
			uploadFile(v) {
				// #ifdef APP
				uni.showToast({
					title: 'app不支持文件上传，请使用小程序版',
					duration: 1000,
					mask: true,
				});
				// #endif

				// #ifdef MP-WEIXIN
				wx.chooseMessageFile({
					count: 1, //限制选择的文件数量
					type: 'file', // 文件类型
					success: (res) => {
						uni.setStorageSync('iscontract', '1')

						const file = res.tempFiles[0]; // 获取选择的文件
						const fileSize = file.size; // 文件大小（单位：字节）
						const fileName = file.name; // 文件名
						const fileType = file.type; // 文件类型
						// 检查文件类型是否为 Word 文件
						const allowedExtensions = ['.doc', '.docx'];
						const fileExtension = fileName.slice(fileName.lastIndexOf('.')).toLowerCase();
						if (!allowedExtensions.includes(fileExtension)) {
							uni.showToast({
								title: '请选择 Word 文件（.doc 或 .docx）',
								duration: 1000,
								icon: 'error',
								mask: true,
								success: () => {
									setTimeout(() => {
										uni.hideLoading();
										uni.setStorageSync('iscontract', '0')
									}, 1000)
								}
							});
							return;
						}

						// 检查文件大小是否超过 25MB
						const maxSize = 25 * 1024 * 1024; // 25MB
						if (fileSize > maxSize) {
							uni.setStorageSync('iscontract', '0')
							console.log('22222')
							uni.showToast({
								title: '文件大小不能超过 15MB',
								duration: 1000,
								icon: 'error',
								mask: true,
								success: () => {
									setTimeout(() => {
										uni.hideLoading();
										uni.setStorageSync('iscontract', '0')
									}, 1000)
								}
							});

							return;
						}

						uni.showLoading({
							title: '合同上传中...'
						})
						const tempFilePaths = res.tempFiles
						console.log(tempFilePaths)
						uni.uploadFile({
							url: systemConfig.apiImg,
							filePath: tempFilePaths[0].path, //选择单个路径
							name: 'file', //后端需要拿到这个Key来获取二进制文件内容
							formData: {
								user: 'test'
							},
							header: {
								'token': uni.getStorageSync('token')
							},
							fail: (err) => {
								console.log(err)
								uni.setStorageSync('iscontract', '0')
								uni.hideLoading();
								uni.showToast({
									title: '上传失败',
									duration: 1000,
									mask: true,
									icon: 'error',
									success: () => {
										setTimeout(() => {
											uni.hideLoading();
											uni.setStorageSync('iscontract',
												'0')
										}, 1000)
									}
								});
							},
							success: (uploadFileRes) => {
								//接口返回的数据
								let data = JSON.parse(uploadFileRes.data)
								//接口返回的状态码
								// console.log(uploadFileRes.status);
								// 
								uni.$u.http.post('/contract/uploadNoSignContract', {
									assignTaskId: v.assignTaskId,
									inputImg: data.result[0]
								}).then(res => {
									if (res) {
										uni.setStorageSync('iscontract', '0')
										uni.hideLoading();
										uni.showToast({
											title: '上传成功',
											duration: 1000,
											mask: true,
											complete: () => {
												setTimeout(() => {
													this.pageNumber = 1
													this.list = []
													this.getTaskList()
													uni.hideLoading();
													uni.setStorageSync(
														'iscontract',
														'0')
												}, 1000)
											}
										});
									} else {
										uni.showToast({
											title: '上传失败',
											duration: 1000,
											mask: true,
											icon: 'error',
											success: () => {
												setTimeout(() => {
													uni.hideLoading();
													uni.setStorageSync(
														'iscontract',
														'0')
												}, 1000)
											}
										});
									}
								})
							}
						});

					}
				})
				// #endif

			},
			viewVideoClose() {
				this.viewVideoShow = false
				this.videoStatus = 0
				this.videoSrc = ''
				this.currentSerialMsg = {}
				this.stopVideo()
			},
			viewVideoFn(serialNumber, storeName, videoName) {
				this.currentSerialMsg = {
					serialNumber,
					storeName,
					videoName: '摄像头' + videoName
				}
				this.viewVideoShow = true
				this.getVideoUrl()
			},
			getVideoUrl() {
				uni.$u.http.get('/firmCamera/getLiveAddress', {
					params: {
						serialNumber: this.currentSerialMsg.serialNumber,
					}
				}).then((res) => {
					if (res) {
						this.videoStatus = 1
						this.videoSrc = res
					} else {
						this.videoStatus = -1
						this.textVideo = '摄像头不在线!'
					}
				})
			},
			videoSrcBindClose() {
				this.videoSrcBind = false
				this.assignTaskId = 0
				this.serialNumber = []
			},
			isRepeatSerialNumber() {
				return new Promise((resolve) => {
					const addSerialNumberArr = this.serialNumber.filter(v1 => !this.list[this.videoSrcBindIndex]
						.serialNumber.includes(v1))
					if (addSerialNumberArr.length) {

						addSerialNumberArr.some(async (serialNumber, index) => {
							const res = await uni.$u.http.get('/appraise/getAssignTaskInfo', {
								params: {
									serialNumber
								}
							})
							if (res.length > 0) {
								// 重复绑定
								uni.showModal({
									title: '提示:',
									content: `监控序列号${serialNumber}已在${res[0].assignName}绑定,是否解绑?`,
									success: (res1) => {
										if (res1.confirm) {
											uni.$u.http.post(
												'/appraise/updateAssignTaskSerialNumber', {
													serialNumber,
													assignTaskId: res[0].assignTaskId
												}).then(res => {
												if (res) {
													uni.$u.toast('解绑成功 :)');
												}
											})
										} else if (res.cancel) {
											uni.$u.toast('用户取消:)');

										}

									}
								})
								resolve(true)
								return true
							}
							if ((addSerialNumberArr.length - 1 == index) && res.length <= 0) {
								console.log('没有重复项')
								// 循环最后一项,并且接口判断无重复项
								resolve(false)
							}

							// return true : 循环结束,找到了满足条件的元素
							// return false : 循环继续,没找到循环继续,如果所有元素全部遍历还是没找到,最终结果为false
						})
					} else {
						resolve(false)
					}
				})



			},
			// 判断数组是否有重复的
			isRepeat(arr) {
				return Array.from(new Set(arr)).length < arr.length
			},
			async onSubmit2() {
				if (this.videoLoad == 1) {
					return uni.showLoading({
						title: '请勿重复提交 :)'
					});
				}

				if (!this.serialNumber.length) {
					return uni.$u.toast('请输入监控序列号:)');
				}

				if (this.isRepeat(this.serialNumber)) {
					return uni.$u.toast('序列号不能重复 :)');
				}
				// 检测监控序列号不能同是被绑定
				// 新增的监控序列号需要校验
				let isRepeat
				isRepeat = await this.isRepeatSerialNumber()
				if (!isRepeat) {
					this.videoLoad = 1
					uni.$u.http.post('/assign/updateAssignTaskAiSerialNumber', {
						assignTaskId: this.assignTaskId,
						serialNumber: this.serialNumber
					}).then(res => {
						if (res) {
							uni.showToast({
								title: '绑定成功',
								duration: 1000,
								mask: true,
								complete: () => {

								}
							});
							this.pageNumber = 1
							this.list = []
							this.getTaskList()
							this.videoSrcBind = false
							// this.serialNumberStr=''
						}
						this.videoLoad = 0
					})
				}


			},
			videoSrcBindFn(msg, index) {
				this.videoSrcBind = true
				this.videoSrcBindIndex = index
				this.serialNumber = msg.serialNumber.length ? [...msg.serialNumber] : ['']
				this.assignTaskId = msg.assignTaskId
				const videoContext = uni.createVideoContext('myVideo', this);
				videoContext.play();
			},
			minusClick(index) {
				if (this.serialNumber.length === 1) {
					return uni.$u.toast('至少添加一条序列号:)');
				}
				this.serialNumber.splice(index, 1)
			},
			plusClick() {
				this.$set(this.serialNumber, this.serialNumber.length, '')
			},
			reviewAcceptance(assignTaskDetailsId, state) {
				uni.navigateTo({
					url: `/pages/acceptance/index?assignTaskDetailsId=${assignTaskDetailsId}&assignTaskId=${this.assignTaskId}&state=${state}`
				})
			},
			storeManage() {
				uni.navigateTo({
					url: '/pages/storeManage/index'
				})
			},
			jianliStoreManage() {
				uni.navigateTo({
					url: '/pages/jianliStoreManage/index'
				})
			},
			otherPepole() {
				return uni.$u.toast('暂无权限:)');
			},
			async searchProvince() {
				this.pageNumber = 1
				this.storeList = [];
				this.provinceShow = false;

				if (this.loginType == 0 || this.loginType == 4) {

				} else if (this.loginType == 1 || this.loginType == 3 || this.loginType == 11) {
					this.province1 = this.province == '全国' ? null : this.province
					this.list = [];
					await this.searchHandler()
					return
				} else if (this.loginType == 2) {

				} else if (this.loginType == 6) {
					await this.search();
					await this.getStatusList()
				}
			},
			async blurSearch() {
				this.pageNumber = 1
				this.storeList = [];
				await this.search()
				await this.getStatusList()
			},
			formatter(type, value) {
				if (type === 'year') {
					return `${value}年`
				}
				if (type === 'month') {
					return `${value}月`
				}
				if (type === 'day') {
					return `${value}日`
				}
				return value
			},
			startTask(id) {
				uni.$u.http.post('/assign/updateDistributionStartTime', {
					distributionId: id
				}).then(res => {
					uni.showToast({
						title: '开始成功',
						duration: 1000,
						mask: true,
						complete: () => {
							setTimeout(() => {
								uni.navigateTo({
									url: '/pages/startOption/index?distributionId=' +
										id
								})
							}, 1000)
						}
					});

				})
			},
			//继续作业

			startOption(id) {
				uni.navigateTo({
					url: '/pages/startOption/index?distributionId=' + id
				})
			},
			checkOption(id) {
				uni.navigateTo({
					url: '/pages/startOption/index?distributionId=' + id
				})
			},
			// checkOption(id){
			// 	uni.navigateTo({
			// 		url:'/pages/startOption/index?distributionId=' + id
			// 	})
			// },
			tabsClick(e) {
				this.currentTab = e.index
				this.pageNumber = 1
				this.storeList = [];
				this.statusNum = e.value;
				this.search();
			},
			async onTimeSubmit(flag) {

				this.timePopShow = false;
				const timeFormat = uni.$u.timeFormat;
				if (flag == '今日') {
					this.timeText = '今日任务'
					this.time1 = timeFormat(new Date(), 'yyyy-mm-dd')
					this.time = new Date()
				} else if (flag == "全部") {
					this.timeText = '全部任务'
					this.time1 = null
					this.time = null
				} else {
					this.time = timeFormat(this.time1, 'yyyy-mm-dd')
					this.pageNumber = 1
					this.storeList = [];
					if (timeFormat(new Date(), 'yyyy-mm-dd') == timeFormat(this.time1, 'yyyy-mm-dd')) {
						this.timeText = '今日任务'
					} else {
						this.timeText = timeFormat(this.time1, 'yyyy-mm-dd');
					}
				}

				await this.getStatusList()
				await this.search();
			},
			timeConfirm(e) {
				this.timeShow = false;
				const timeFormat = uni.$u.timeFormat;
				this.time1 = timeFormat(e.value, 'yyyy-mm-dd')
				console.log(this.time1)
				this.onTimeSubmit()
			},
			timeCancel() {
				this.timeText = '今日任务'
				this.timeShow = false;
			},
			timeClose() {
				this.timeText = '今日任务'
				this.timeShow = false;
			},
			search() {
				const timeFormat = uni.$u.timeFormat;
				let tempTime
				if (this.timeText === '今日任务') {
					tempTime = timeFormat(new Date(), 'yyyy-mm-dd')
				} else if (this.timeText === '全部任务') {
					tempTime = null
				} else {
					tempTime = this.timeText
				}
				let params = {
					storeName: this.keyword,
					address: this.province == '全国' ? '' : this.province,
					state: this.statusNum, // 未开始 0 ,进行中 1 ,已逾期 2，已完成 3
					pageSize: 20,
					pageNumber: this.pageNumber,
					time: tempTime
				}
				uni.$u.http.get('/assign/getWorkerHomeVo', {
					params: params
				}).then(res => {
					this.storeList = [...this.storeList, ...res]
				})
			},
			provinceRadioChange(e) {
				console.log(e);
			},
			toIndex(id) {
				uni.navigateTo({
					url: '/pages/details/index?assignTaskId=' + id
				})
			},
			getUserInfo() {
				uni.$u.http.get('/user/userInfo').then(async res => {
					if (res) {
						this.isLogin = true;
						uni.setStorageSync('avatar', res.avatar)
						uni.setStorageSync('nickName', res.nickName)
						uni.setStorageSync('roleId', res.roleId)
						uni.setStorageSync('userId', res.userId)
						uni.setStorageSync('loginType', res.loginType)
						uni.setStorageSync('userId', res.userId)
						uni.setStorageSync('companyName', res.companyName)
						uni.setStorageSync('companyId', res.companyId)
						if (res.companyId) {
							this.changeCompanyId(res.companyId)
						}
						this.loginType = res.loginType;
						this.isLogin = true
						if (this.loginType == 0 || this.loginType == 4) {
							// await this.getStarTechnician();
							// await this.collaborationCase();
						} else if (this.loginType == 1 || this.loginType == 3 || this.loginType == 11) {
							this.getTaskList()
							this.companyName = uni.getStorageSync('companyName');
						} else if (this.loginType == 2) {
							//
						} else if (this.loginType == 6) {
							await this.search();
							await this.getStatusList()
						}
						if ([7, 8, 9].includes(this.loginType)) {
							console.log(',,,')
							this.getTodoCount()
							this.getInspectionTaskCount()
						}

					} else {
						this.isLogin = false

					}
				})
			},
			getStatusList() {
				const timeFormat = uni.$u.timeFormat;
				console.log(this.province, 0)
				let tempTime
				if (this.timeText === '今日任务') {
					tempTime = timeFormat(new Date(), 'yyyy-mm-dd')
				} else if (this.timeText === '全部任务') {
					tempTime = null
				} else {
					tempTime = this.timeText
				}
				uni.$u.http.get('/assign/getWorkerHomeInfo', {
					params: {
						address: this.province == '全国' ? null : this.province,
						time: tempTime,
						storeName: this.keyword,
					}
				}).then(async res => {
					this.statusList[0].badge.value = res.totalNum;
					this.statusList[1].badge.value = res.stayNum;
					this.statusList[2].badge.value = res.wayNum;
					this.statusList[3].badge.value = res.overdueNum;
					this.statusList[4].badge.value = res.completeNum;

				})
			},
			close() {
				this.provinceShow = false;
			},
			toTalentPool() {
				uni.navigateTo({
					url: '/pages/talentPool/index'
				})
			},
			// renovation
			assignStartWork(assignTaskId) {
				uni.$u.http.post('/assign/startWork', {
					assignTaskId
				}).then(res => {
					if (res) {
						uni.showToast({
							title: '开工成功',
							duration: 1000,
							mask: true,
							complete: () => {


								// setTimeout(()=>{
								// 	uni.navigateTo({
								// 		url:`/pages/taskAllocation/index?assignTaskId=${assignTaskId}`
								// 	})
								// },1000)

								setTimeout(() => {
									uni.navigateTo({
										url: `/pages/taskAllocation/index?assignTaskId=${assignTaskId}`
									})
								}, 1000)
							}
						});
					}
				})
			},
			taskProgress(assignTaskId, brandPartyId) {
				uni.navigateTo({
					url: `/pages/taskAllocation/index?assignTaskId=${assignTaskId}&brandPartyId=${brandPartyId}`
				})
			},
			// scrolltolower(){
			// 	if(this.list.length>=this.total){
			// 		this.status='noMore'
			// 		return
			// 	}
			// 	this.pageNumber++
			// 	this.getTaskList()
			// },
			deChange() {
				uni.$u.debounce(this.change, 1000)

			},
			changeTaskState(e) {
				console.log(e)
				this.currentTab = e.index
				this.taskState = e.value
				this.list = []
				this.pageNumber = 1
				this.getTaskList()
				// this.currentTask=index
			},
			changeTaskState11(e) {
				console.log('tab 点击', e);
				this.currentTab = e.index
				this.taskState = e.value
				this.list = []
				this.pageNumber = 1
				if (e.index == 0) {
					this.getTaskList()
				} else {
					this.status = 'loading'
					const params = {
						pageNumber: this.pageNumber,
						pageSize: this.pageSize,
						address: this.province1 == '全国' ? '' : this.province1,
						storeName: this.searchKey,
						supplierTaskState: e.value
					}

					uni.$u.http.get('/assign/getCompanyHomeVo', {
						params
					}).then(async res => {
						if (res) {
							let tampList = res.data.map(item => {
								item.serialNumber = item.serialNumber || []
								return item
							})
							this.list = [...this.list, ...tampList]
							this.total = res.total
							if (this.list.length >= this.total) {
								this.status = 'noMore'
							} else {
								this.status = 'more'
							}
						}
						uni.stopPullDownRefresh()
					}).then(() => {
						// 为了刷新统计数量
						uni.$u.http.get('/assign/getCompanyHomeCount', {
							params: {
								address: this.province1,
								storeName: this.searchKey
							}
						}).then(res => {
							this.suppierList = [{
								name: '全部',
								value: null,
								badge: {
									value: res.supplierTotalCount
								}
							}, {
								name: '待确认',
								value: 1,
								badge: {
									value: res.supplierNotConfirmedCount
								}
							}, {
								name: '待开工',
								value: 2,
								badge: {
									value: res.supplierNotStartWorkCount
								}
							}, {
								name: '进行中',
								value: 3,
								badge: {
									value: res.supplierUnderwayCount
								}
							}, {
								name: '待验收/结算',
								value: 4,
								badge: {
									value: res.supplierNotInspectedCount
								}
							}, {
								name: '已完成',
								value: 5,
								badge: {
									value: res.supplierCompletedCount
								}
							}, ]

							// this.suppierList = [{
							// 	name: '全部',
							// 	value: null,
							// 	badge: {
							// 		value: res.totalCount
							// 	}
							// }, {
							// 	name: '未完成',
							// 	value: null,
							// 	badge: {
							// 		value: res.supplierNotTaskCount
							// 	}
							// }, {
							// 	name: '已完成',
							// 	value: null,
							// 	badge: {
							// 		value: res.supplierIsTaskCount
							// 	}
							// }, ]
						})
					})
				}



			},
			change() {
				this.pageNumber = 1
				this.list = []
				this.getTaskList()
			},
			searchHandler1(e) {
				if (e.value[0] == '全部') {
					this.companyName = null
					this.companyId = null
				} else {
					this.companyName = e.value[0]

					this.companyId = this.companyList[e.indexs[0] - 1].companyId
				}
				this.showCompanyName = false
				this.pageNumber = 1
				this.list = []
				this.getTaskList()
			},
			searchHandler() {
				this.pageNumber = 1
				this.getTaskList()
			},
			addClick() {
				if (![7, 10].includes(this.loginType)) return uni.$u.toast('您无建店权限:)')
				uni.navigateTo({
					url: '/packageB/pages/createTask1/index'
				})
				// if(this.loginType==1||this.loginType==3){
				// 	uni.navigateTo({
				// 		url:'/packageB/pages/createTask1/index'
				// 	})
				// }else{
				// 	uni.$u.toast('无权限:)')
				// }

			},
			getTaskList() {
				this.status = 'loading'
				const params = {
					pageNumber: this.pageNumber,
					pageSize: this.pageSize,
					address: this.province1 == '全国' ? '' : this.province1,
					storeName: this.searchKey,
					state: this.taskState
				}

				uni.$u.http.get('/assign/getCompanyHomeVo', {
					params
				}).then(async res => {
					if (res) {
						let tampList = res.data.map(item => {
							item.serialNumber = item.serialNumber || []
							return item
						})
						this.list = [...this.list, ...tampList]
						this.total = res.total
						if (this.list.length >= this.total) {
							this.status = 'noMore'
						} else {
							this.status = 'more'
						}
					}
					uni.stopPullDownRefresh()
				}).then(() => {
					uni.$u.http.get('/assign/getCompanyHomeCount', {
						params: {
							address: this.province1,
							storeName: this.searchKey
						}
					}).then(res => {
						// 改版的
						this.suppierList = [{
							name: '全部',
							value: null,
							badge: {
								value: res.supplierTotalCount
							}
						}, {
							name: '待确认',
							value: 1,
							badge: {
								value: res.supplierNotConfirmedCount
							}
						}, {
							name: '待开工',
							value: 2,
							badge: {
								value: res.supplierNotStartWorkCount
							}
						}, {
							name: '进行中',
							value: 3,
							badge: {
								value: res.supplierUnderwayCount
							}
						}, {
							name: '待验收/结算',
							value: 4,
							badge: {
								value: res.supplierNotInspectedCount
							}
						}, {
							name: '已完成',
							value: 5,
							badge: {
								value: res.supplierCompletedCount
							}
						}, ]

						// 旧的
						// this.suppierList = [{
						// 	name: '全部',
						// 	value: null,
						// 	badge: {
						// 		value: res.totalCount
						// 	}
						// }, {
						// 	name: '未完成',
						// 	value: null,
						// 	badge: {
						// 		value: res.supplierNotTaskCount
						// 	}
						// }, {
						// 	name: '已完成',
						// 	value: null,
						// 	badge: {
						// 		value: res.supplierIsTaskCount
						// 	}
						// }, ]
						this.statusList1 = [{
								name: '全部',
								value: null,
								badge: {
									value: res.totalCount
								}
							},
							{
								name: '待确认',
								value: 0,
								badge: {
									value: res.confirmedCount
								}
							},
							{
								name: '待测量',
								value: 1,
								badge: {
									value: res.measuredCount
								}
							},
							{
								name: '待支付',
								value: 2,
								badge: {
									value: res.signedCount
								}
							},
							{
								name: '待开工',
								value: 5,
								badge: {
									value: res.startedCount
								}
							},
							{
								name: '进行中',
								value: 6,
								badge: {
									value: res.inProgressCount
								}
							},
							{
								name: '已完成',
								value: 9,
								badge: {
									value: res.completedCount
								}
							},
							{
								name: '已逾期',
								value: 7,
								badge: {
									value: res.overdueCount
								}
							},
						]
					})



				})
			},
			toDetails(msg) {
				// uni.navigateTo({
				// 	url: `/pages/details/index?status=${msg.status}&assignTaskId=${msg.assignTaskId}&assignName=${msg.assignName}&createTime=${msg.createTime}&address=${msg.address}&customerScore=${msg.customerScore}&projectUserName=${msg.projectUserName}&userName=${msg.userName}&customerPhone=${msg.customerPhone}&userPhone=${msg.userPhone}&chargePhone=${msg.chargePhone}&projectPhone=${msg.projectPhone}&afterPhone=${msg.afterPhone}`
				// })
				uni.navigateTo({
					url: `/pages/details/index?assignTaskId=${msg.assignTaskId}`
				})
			},
			// toPath() {
			// 	uni.navigateTo({
			// 		url: '/pages/noticeDetail/index',
			// 	})
			// },
			getCompanyListMini() {
				uni.$u.http.get('/company/getCompanyListMini', {
					params: {
						pageNumber: 1,
						pageSize: 999999,
					}
				}).then((res) => {
					if (res.data) {
						console.log(res.data)
						this.companyList = res.data
						const comanyListArr = res.data.map(item => item.companyName)
						this.columns1 = [
							['全部', ...comanyListArr]
						]
						console.log(comanyListArr, this.columns1[0])
					}

				})
			},

		}
	}
</script>
<style>
	page {
		background: #f8f8f8;
		font-size: 24rpx;
	}
</style>
<style lang="scss" scoped>
	.workItem {
		font-size: 24rpx;
		width: 100rpx;
		display: flex;
		justify-content: center;
		flex-direction: column;
		align-items: center;
	}

	.floor {
		background-color: #fff;
		border-radius: 10rpx;
		padding: 20rpx;
		margin-bottom: 20rpx;

		.title {
			font-weight: 600;
			font-size: 30rpx;
		}
	}

	.viewVideo {
		width: 95vw;
		font-size: 28rpx;
		font-weight: 700;
		padding: 20rpx;
		box-sizing: border-box;

		.viewVideo_v {
			font-size: 28rpx;
			font-weight: 700;
		}
	}

	.uploadForm {
		max-height: 60vh;
		overflow-y: auto;
		padding: 50rpx 15rpx;
	}

	.upload_title {
		font-weight: 700;
		display: flex;
		justify-content: center;
	}

	// ::v-deep.company{
	// 	.u-tabs__wrapper__nav__item{
	// 		padding: 0 !important;
	// 	}
	// }
	.overdueForm {
		padding: 100rpx 30rpx 50rpx 30rpx;
	}

	.btn111 {
		width: 160rpx;
		line-height: 64rpx;
		border-radius: 24rpx;
		background-color: #13989a;
		font-weight: 500;
		color: #fff;
		text-align: center;
		margin-left: 200rpx;
	}

	.container {
		width: 700rpx;
		padding: 0 25rpx;
		position: absolute;
		top: 370rpx;
		left: 0;
		z-index: 10
	}

	.bg {
		width: 750rpx;
		height: 430rpx;
		position: absolute;
		top: 0;
		left: 0;
		z-index: 1;
	}

	.starTechnician {
		padding: 20rpx;
		width: calc(100% - 40rpx);
		margin: 20rpx 0;
		// box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border-radius: 10rpx;
		background-color: white;

	}



	.textTitle {
		font-size: 28rpx;
		margin-bottom: 20rpx;
		font-weight: 700;
		color: #1E272E;
	}

	.lineTitle {
		padding-bottom: 20rpx;
		font-size: 32rpx;
		font-weight: 700;
		display: flex;
		justify-content: space-between;
		border-bottom: 1rpx solid #eee;
	}

	.starList {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		margin-top: 20rpx;
	}

	.searchBar {
		position: absolute;
		left: 25rpx;
		width: 700rpx;
		z-index: 10;
		display: flex;
		align-items: center;

	}

	.storeListItem {
		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
		border-radius: 10rpx;
		width: calc(100% - 40rpx);
		padding: 20rpx;
		margin-top: 30rpx;
		display: flex;
		// align-items: center;
		background-color: white;
	}

	.textLine {
		padding: 40rpx 20rpx;
		font-size: 24rpx;
		margin-bottom: 22rpx;
		background: linear-gradient(-90deg, #DCF3F5, #EBF4F5);
		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
		border-radius: 20rpx;
		color: #1E272E;
		display: flex;
		justify-content: space-between;
		align-items: center;
		text-align: center;
	}

	.itemContent {
		background: white !important;
		padding: 40rpx 30rpx;
		// box-shadow: none !important;
	}

	.todayTask {
		font-weight: bold;
		font-size: 32rpx;
		color: #1E272E;
		margin-right: 10rpx
	}

	.workerSearch {
		border-radius: 40rpx;
		display: flex;
		align-items: center;
		padding-left: 22rpx;
		width: 496rpx;
		height: 78rpx;
		background-color: white;
		opacity: 0.9;
	}

	.worker /deep/ .u-tabs__wrapper__nav__item {
		padding: 0 !important;
	}

	.province {
		font-size: 30rpx;
		margin: 0 20rpx 0 10rpx;
		width: 50rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		word-break: break-all;
	}

	.listContent {
		width: 700rpx;
	}

	.listItem {
		background-color: white;
		height: 257rpx;
		padding: 20rpx 30rpx;
		border-radius: 20rpx;
		margin-top: 20rpx;
		display: flex;
		align-items: flex-start;
		overflow: hidden;
		position: relative;
	}

	.stateTag {
		position: absolute;
		top: 0;
		right: 0;
		background-color: #13989A;
		color: white;
		padding: 10rpx 20rpx;
		border-bottom-left-radius: 20rpx;
	}

	.stateTag1 {
		position: absolute;
		top: 0;
		left: 0;
		background-color: #4d90fe;
		color: white;
		font-size: 24rpx;
		padding: 5rpx 10rpx;
		border-bottom-right-radius: 20rpx;
		border-top-left-radius: 20rpx;
	}

	.stateTag3 {
		position: absolute;
		top: 0;
		left: 0;
		background-color: #80c342;
		color: white;
		font-size: 24rpx;
		padding: 5rpx 10rpx;
		border-bottom-right-radius: 20rpx;
		border-top-left-radius: 20rpx;
	}

	.stateTag2 {
		position: absolute;
		top: 0;
		left: 0;
		background-color: #ffc700;
		color: white;
		font-size: 24rpx;
		padding: 5rpx 10rpx;
		border-bottom-right-radius: 20rpx;
		border-top-left-radius: 20rpx;
	}

	.btn {
		width: 150rpx;
		height: 60rpx;
		border-radius: 30rpx;
		text-align: center;
		line-height: 60rpx;
		position: absolute;
		bottom: 20rpx;
		right: 20rpx;
		font-weight: 500;
		font-size: 30rpx;

	}

	.stateBtn {
		background: #E7F4F5;
		color: #13989a;
	}

	.cameraBox {
		position: absolute;
		bottom: 10px;
		left: 10px;
	}
</style>